package com.study.java8.functioninterface;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class E1 {

    public static void main(String[] args){
        String[] names = {"tom", "jack", "sam"};
        List<String> collect = IntStream.range(0, names.length)
                .mapToObj(index -> index + ":" + names[index])
                .collect(Collectors.toList());

        collect.forEach(System.out::println);

    }
}
